
import request from '@/utils/request'
// 商机录入跟进
export function follow (data) {
  return request({
    method: 'POST',
    url: '/assess/assess/followUpSaveBusiness',
    data: data
  })
}
// 根据车的品牌查询
export function CarName () {
  return request({
    method: 'GET',
    // url: 'system/uc/getBrand',
    url: '/system/uc/getBrandInfoList',
    headers: {
      'Content-Type': 'application/json',
      apikey: 'svwuc'
    }
  })
}
// 根据车的品牌查找车系
export function CarSeries (params) {
  return request({
    headers: {
      'Content-Type': 'application/json',
      apikey: 'svwuc'
    },
    method: 'GET',
    url: '/system/uc/getSeriesInfoListByBrandId',
    params
  })
}
// 车型的具体信息
export function CarDetailInfo (params) {
  return request({
    headers: {
      'Content-Type': 'application/json',
      apikey: 'svwuc'
    },
    method: 'GET',
    url: '/system/uc/getModelInfoListGroup',
    params
  })
}
// 根据条件查询车型
export function QueryCarInfo (params) {
  return request({
    method: 'GET',
    url: '/system/uc/getBrandInfoList',
    headers: {
      apikey: 'svwuc'
    },
    params
  })
}

// 获取颜色的数据字典
export function GainColor (type) {
  return request({
    headers: {
      'Content-Type': 'application/json',
      apikey: 'svwuc'
    },
    method: 'GET',
    url: `/system/uc/code/${type}`
  })
}
// 使用性质
export function UserInzhi (type) {
  return request({
    headers: {
      'Content-Type': 'application/json',
      apikey: 'svwuc'
    },
    method: 'GET',
    url: `/system/uc/code/${type}`
  })
}
// 商机录入-跟进
export function FollowBusiness (data) {
  return request({
    headers: { 'Content-Type': 'application/json' },
    method: 'POST',
    url: '/assess/assess/followUpSaveBusiness',
    data: data
  })
}
// 图片上传
export function UPloadPhoto (data) {
  return request({
    headers: {
      'Content-Type': 'application/json',
      apikey: 'svwuc'
    },
    method: 'POST',
    url: '/system/uc/obsUpload',
    data
  })
}
// 从字典里面附属物品的接口
export function GoodsInfo (type) {
  return request({
    headers: {
      'Content-Type': 'application/json',
      apikey: 'svwuc'
    },
    method: 'GET',
    url: `/system/uc/initVhclAttach/${type}`
  })
}
// 商机列表部分
export function goodlist (params) {
  return request({
    method: 'GET',
    url: '/assess/assess/getDlrBusinessList',
    params
  })
}
// 根据商机id查询详情
export function ListDetail (businessId) {
  return request({
    method: 'GET',
    url: `/assess/assess/getBusinessInfoById/${businessId}`
  })
}
// 评估结果
export function EvelationResult (custIntentId) {
  return request({
    method: 'GET',
    url: `/assess/eva/getEvaResultDetail/${custIntentId}`
  })
}
// 精确估价
export function EvelatePrice (data) {
  return request({
    method: 'POST',
    url: '/assess/eva/accurateQuotation',
    params: data
  })
}
// 签约保存
export function SaveProtocol (data) {
  return request({
    method: 'POST',
    url: '/assess/assess/signProtocol',
    data
  })
}
// 成交入库
export function GetGarage (data) {
  return request({
    method: 'POST',
    url: '/assess/assess/vhclStorage',
    data
  })
}
// 车辆评估部件查询
export function QueryAccessPart (type) {
  return request({
    method: 'GET',
    url: `/assess/getEvaPart/${type}`
  })
}
// 评估损伤项查询
export function QueryDescrible (partCode) {
  return request({
    method: 'GET',
    url: `/assess/getEvaPartDmg/${partCode}`
  })
}
// 10-30部件损伤项
export function GetEvaPartByIndexNo(params) {
  return request({
    method: 'GET',
    url: '/assess/getEvaPartByIndexNo',
    params
  })
}
// 暂存车辆部件评估项
export function SavePart (data) {
  return request({
    method: 'POST',
    url: '/assess/eva/temporarySaveEvaPart',
    params: data
  })
}
// 查询暂存的评估损伤项
export function QuerySavePart(params) {
  return request({
    method: 'GET',
    url: '/assess/eva/getPartEvaList',
    params
  })
}
// 删除暂存的评估损伤项
export function DeleteSavePart(data) {
  return request({
    method: 'POST',
    url: '/assess/eva/deletePartEvaById',
    data
  })
}
// 外部接口获取车辆评估图片位置
export function GetAccessImage (type) {
  return request({
    method: 'GET',
    url: `/system/uc/code/${type}`,
    headers: {
      apikey: 'svwuc'
    }
  })
}
// 做完车辆检测后回显图片
export function GetPicture (custIntentId) {
  return request({
    method: 'GET',
    url: `/assess/eva/getVhclPic/${custIntentId}`
  })
}
// 保存车辆评估信息
export function SaveEvaVhcl(data) {
  return request({
    method: 'POST',
    url: '/assess/eva/saveEvaVhcl',
    data
  })
}
// 保存最终判定车辆部件评估损伤项
export function SaveEvaPart(data) {
  return request({
    method: 'POST',
    url: '/assess/eva/saveEvaPart',
    data
  })
}
// 首次评估结果
export function FirstEvelationResult (vhclEvaId) {
  return request({
    method: 'GET',
    url: `/assess/eva/getFirstEvaResultDetail/${vhclEvaId}`
  })
}
// 在组件中引入
// import { login } from '@/api/user'
// 在方法中写
// async onSubmit () {

// 调用信息提示按钮
// this.$toast.loading({
//   duration: 0, // 持续时间，默认时间2s，0表示持续展示不停止，直到成功或失败
//   forbidClick: true, // 是否禁止背景点击（forbid：禁止）
//   message: '登录中...' // 提示消息
// })
// this.$toast.success('登录成功')
// this.$toast.fail('手机号或验证码错误')
// this.$toast.fail('登录失败，请稍后重试')

//   try {
//     const res = await login(this.user)
//     console.log('登录成功', res)
//   } catch (err) {
//     if (err.response.status === 400) {
//     console.log('手机号或验证码错误', err)
//     }else{
//         console.log('登录失败，请稍候重试', err)
//     }
//   }
// }

// 提示按钮
